package com.example.navigation.api.statistic

import com.example.navigation.api.MyPage
import com.example.navigation.api.ResponseData
import com.google.gson.annotations.SerializedName
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * Created with IntelliJ IDEA.
 * @Author: Liao Run
 * @Date: 2024-06-12 9:26
 * @Description:
 **/
interface StatisticApi {

    @GET("/category/dlpage")
    suspend fun getRoadPmStatisticRank(
        @Query("startime") startTime: String,
        @Query("endtime") endTime: String,
        @Query("qy") qy: String,
        @Query("page") page: Int = 1,
        @Query("pageSize") pageSize: Int = Int.MAX_VALUE,
        @Query("state") state: Int = 32
    ): ResponseData<MyPage<RoadRank>>
}

data class RoadRankItem(
    @SerializedName("dlname") val roadName: String,
    @SerializedName("dltype") val roadType: String,
    @SerializedName("avgnum") val avgPm: String,
    val id: Int
)

typealias RoadRank = Array<RoadRankItem>